package com.bjesc_b2c.app.appraiset.adapter;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.R;

import java.util.List;

import app.pinggushi.bjesc.com.baserecyclerview.adapter.CommonAdapter;
import app.pinggushi.bjesc.com.baserecyclerview.adapter.base.ViewHolder;
import master_bean.CarForBean;

/**
 * Created by yidong on 2017/8/2.
 */

public class WaitCheckCarAdapter extends CommonAdapter<CarForBean> {
    public WaitCheckCarAdapter(Context context, int layoutId, List<CarForBean> datas) {
        super(context, layoutId, datas);
    }
//  "id": "13",
//          "address": "云南大理",
//          "boss": "张",
//          "phone": "13982110343",
//          "name": "豪车云集",
//          "track_num": "4"
    @Override
    protected void convertView(ViewHolder holder, CarForBean bean, int position) {
        holder.setText(R.id.tv_dealer_name,bean.getName());
        holder.setText(R.id.tv_dealer_address,bean.getAddress());
        holder.setText(R.id.tv_name_phone,bean.getBoss()+"  "+bean.getPhone());
        if (bean.getTrack_num() > 0){
            holder.setVisible(R.id.tv_check_type,true);
            holder.setText(R.id.tv_check_type,mContext.getString(R.string.track_count,bean.getTrack_num()+""));
        }else {
            holder.setVisible(R.id.tv_check_type,false);
        }
        if (bean.getUnusual_num() > 0){
            holder.setVisible(R.id.tv_unusual_num,true);
            holder.setText(R.id.tv_unusual_num,mContext.getString(R.string.unusual_count,bean.getUnusual_num()+""));
        }else {
            holder.setVisible(R.id.tv_unusual_num,false);
        }

    }
}
